#ifndef __PRODUCT_HPP__
#define __PRODUCT_HPP__

#include <vector>
#include <iostream>
#include <string>

using std::vector;
using std::cout;
using std::endl;
using std::string;

class Product {
public:
	Product() { cout<<__func__<<endl; name.clear(); price.clear(); }
	~Product() { cout<<__func__<<endl; }
	void add(const string &name, int price) { this->name.push_back(name); this->price.push_back(price); }
	void show();
private:
	vector<string> name;
	vector<int> price;
};

inline void Product::show()
{
	int total = 0;
	int i = 0;
	for ( i = 0; i < name.size(); i++) {
		total += price[i];
		cout<<name[i]<<" = "<<price[i]<<" (dollar)"<<endl;
	}
	cout<<"*** Total = "<<total<<" dollar"<<endl;
}

#endif /* end of include guard */
